//
//  CategoryType.swift
//  KoiAccounting
//
//  Created by 纪洪文 on 23.03.25.
//

import Foundation
enum CategoryType : String{
    case expense
    case income
    
    static func getType(type: String) -> CategoryType {
        switch(type) {
        case CategoryType.expense.rawValue:
            return CategoryType.expense
        case CategoryType.income.rawValue:
            return CategoryType.income
        default:
            return CategoryType.expense
        }
    }
}

extension CategoryType {
    
    func typeName() -> String {
        switch self {
        case .expense:
            return "支出"
        case .income:
            return "收入"
        }
    }
    
    
}
